package example2;
import  static example2.OrderServive.addOrder;

public class Test {
public static void main(String[] args){
    Product p1 = new Product("电脑",8000);
    Product p2 = new Product("手机",5000);
    User u1 = new User("晨",50000,"黑龙江");
    Item I1 = new Item(p1,2);
    Item I2 = new Item(p2,3);
    Item[] items = {I1,I2};
    double endBalance = 0;
    Order order = addOrder(u1,items);
    if(order != null) {
        endBalance = u1.getBalance() - order.getCost();
        System.out.println(order.getCost());
        System.out.println(endBalance);
        System.out.println(u1.getAddress());
    }
    else {
        System.out.println("用户余额不足");
    }
    }


}



